import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    islogin:false, // 是否有登录
    areaMsg:{}, //登录用户的社区信息
    choose_time:{},  //用户选择的充电方式和时间
    adminuser:null,   //当前登陆用户
    love_station:null,  //用户收藏的充电站
    myPosition: {lng: 113.323924, lat: 23.175318}, //我的位置 Bd09
  },
  mutations: {
    changeislogin (state,payload) {
      state.islogin=payload
    },
    changeAreaMsg (state,payload) {
      state.areaMsg={...payload.areaMsg}
    },
    changechoose_time (state,payload) {
      state.choose_time={...payload.choose_time}
    },
    changeadminuser (state,payload) {
      state.adminuser=payload
    },
    changeloveStation (state,payload) {
      state.love_station=payload
    },
    changeMyPosition (state,payload){
      state.myPosition = payload
    }
  },
  actions: {
  },
  modules: {
  }
})
